<?php

class ActionView extends BaseAction
{
    public $pageId = 'news_view';

    public function run()
    {
        $iNewsId = Yii::app()->request->getParam('news_id');
        $oNews   = News::model()->findByPk($iNewsId);
        
        if ( $oNews )
        {
            $this->template->oNews = $oNews;
        }
        else
        {
            Yii::app()->controller->redirect(Yii::app()->controller->createUrl('/news'));
        }
    }
}